
export default class Director {
    static STATUS = {
        READY: 1,
        RUNNING: 2,
        END: 3,
    }
    constructor(canvas, scenes = []) {
        this.canvas = canvas;
        this.scenes = scenes;
        this.currentScene = 0;
    }
    hasNext() {
        return this.currentScene >= this.scenes.length - 1;
    }

    addScene(scene) {
        this.scenes.push(scene);
    }

    next() {
        this.currentScene++;
        return this.scenes[this.currentScene];
    }
    runScene(scene) {
        this.canvas.splice(0);
        this.canvas.addChild(this.scenes[this.currentScene]);
        this.canvas.paint();
    }
}
